﻿using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using FApp = System.Windows.Forms.Application;

namespace WPFTestDemo
{
    public class Startup
    {
        // Import user32.dll (containing the function we need) and define
        // the method corresponding to the native function.
        [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        private static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, uint uType);

        /// <summary>
        /// Application Entry Point.
        /// </summary>
        [System.STAThreadAttribute()]
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "5.0.6.0")]
        public static void Main(string[] args)
        {
            var wpfApp = new System.Windows.Application();
            wpfApp.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
            wpfApp.Run();
        }

        //private static async Task StartWindow()
        //{
        //    // 启动WPF窗口
        //    await Task.Run(() =>
        //    {
        //        var wpfApp = new System.Windows.Application();
        //        wpfApp.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
        //        wpfApp.Run();
        //    });
        //}

        //private static async Task StartForm()
        //{
        //    await Task.Run(() =>
        //    {
        //        var form = new System.Windows.Forms.Form();
        //        FApp.Run(form);
        //    });
        //}
    }
}
